from django.shortcuts import render
from django.http import JsonResponse,HttpResponse
from area.models import *


def getcity(request,code):
    city = City.objects.filter(code=code).first()
    if city:
        province = Province.objects.filter(code=city.provinceCode).first()
        return JsonResponse({"city":city.name,"province":province.name})
